package com.huawei.classroom.student.h17;

public class WarFactory extends GameObject{
	public WarFactory(Player player, int x, int y) {
		super(player, x, y, BattleField.getread_ini("warFactory.range"), BattleField.getread_ini("warFactory.strength"), BattleField.getread_ini("warFactory.health"));
	}
	
	public GameObject building(EnumObjectType type) {//建对象
		GameObject gameObject = null;
		if(type == EnumObjectType.heavyTank) {
			gameObject = new HeavyTank(getplayer(), getX(), getY());
		}
		else if(type == EnumObjectType.mediumTank){
			gameObject = new MediumTank(getplayer(), getX(), getY());
		}
		else return gameObject;
		BattleField.gameObjects.add(gameObject);
		return gameObject;
	}
}
